#include <iostream>
#include <vector>
using namespace std;
#define int long long 
vector<int> a(100010);
vector<int> b(100010);
signed main() {
    int n;
    cin >> n;
    int suma = 0, sumb = 0;
    for(int i = 1; i <= n; i++) {
        cin >> a[i];
    }
    for(int j = 1; j <= n; j++) {
        b[j] = a[j] - a[j - 1];
        if(j >= 2) {
            if(b[j] > 0) {
                suma += b[j];
            }else {
                sumb += b[j];
            }
        }
    }
    cout << max(suma, abs(sumb)) << endl;
    cout << abs(suma - abs(sumb)) + 1 << endl;

    return 0;
}